Telegram Group & Telegram Channel
23. Christmas tree.

class ChristmasTree
{
public static final int segments = 4;
public static final int height = 4;

public static void main(String[] args)
{
makeTree();
}

public static void makeTree()
{
int maxStars = 2 * height + 2 * segments - 3;
String maxStr = "";
for (int l = 0; l < maxStars; l++)
{
maxStr += " ";
}

for (int i = 1; i <= segments; i++)
{
for (int line = 1; line <= height; line++)
{
String starStr = "";
for (int j = 1; j <= 2 * line + 2 * i - 3; j++)
{
starStr += "*";
}

for (int space = 0; space <= maxStars - (height + line + i); space++)
{
starStr = " " + starStr;
}
System.out.println(starStr);
}
}

for (int i = 0; i <= maxStars / 2; i++)
{
System.out.print(" ");
}

System.out.println(" " + "*" + " ");

for (int i = 0; i <= maxStars / 2; i++)
{
System.out.print(" ");
}

System.out.println(" " + "*" + " ");

for (int i = 0; i <= maxStars / 2 - 3; i++)
{
System.out.print(" ");
}

System.out.println(" " + "*******");
}
}

@java_Codings



tg-me.com/java_codings/34
Create:
Last Update:

23. Christmas tree.

class ChristmasTree
{
public static final int segments = 4;
public static final int height = 4;

public static void main(String[] args)
{
makeTree();
}

public static void makeTree()
{
int maxStars = 2 * height + 2 * segments - 3;
String maxStr = "";
for (int l = 0; l < maxStars; l++)
{
maxStr += " ";
}

for (int i = 1; i <= segments; i++)
{
for (int line = 1; line <= height; line++)
{
String starStr = "";
for (int j = 1; j <= 2 * line + 2 * i - 3; j++)
{
starStr += "*";
}

for (int space = 0; space <= maxStars - (height + line + i); space++)
{
starStr = " " + starStr;
}
System.out.println(starStr);
}
}

for (int i = 0; i <= maxStars / 2; i++)
{
System.out.print(" ");
}

System.out.println(" " + "*" + " ");

for (int i = 0; i <= maxStars / 2; i++)
{
System.out.print(" ");
}

System.out.println(" " + "*" + " ");

for (int i = 0; i <= maxStars / 2 - 3; i++)
{
System.out.print(" ");
}

System.out.println(" " + "*******");
}
}

@java_Codings

BY Advance Java πŸ‘¨β€πŸ’»


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/java_codings/34

View MORE
Open in Telegram


Advance Java ‍ Telegram | DID YOU KNOW?

Date: |

That strategy is the acquisition of a value-priced company by a growth company. Using the growth company's higher-priced stock for the acquisition can produce outsized revenue and earnings growth. Even better is the use of cash, particularly in a growth period when financial aggressiveness is accepted and even positively viewed.he key public rationale behind this strategy is synergy - the 1+1=3 view. In many cases, synergy does occur and is valuable. However, in other cases, particularly as the strategy gains popularity, it doesn't. Joining two different organizations, workforces and cultures is a challenge. Simply putting two separate organizations together necessarily creates disruptions and conflicts that can undermine both operations.

Start with a fresh view of investing strategy. The combination of risks and fads this quarter looks to be topping. That means the future is ready to move in.Likely, there will not be a wholesale shift. Company actions will aim to benefit from economic growth, inflationary pressures and a return of market-determined interest rates. In turn, all of that should drive the stock market and investment returns higher.

Advance Java ‍ from hk


Telegram Advance Java πŸ‘¨β€πŸ’»
FROM USA